import random, time

def random_lottery():
    list_red = [x for x in range(1, 33)]      # 红色球序列为：1~33号
    res = random.sample(list_red, 6)          # 随机选取6个红球
    res.sort()                                # 对选取的6个红球排序
    res.append(random.randint(1, 16))         # 随机选取1个蓝球，蓝球为1-16号

    return res

if __name__ == '__main__':
    for i in range(5):

        res_ = random_lottery()
        now_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())      # 获取当前时期
        print('今日%r双色球选号(%r): %r.' % (now_time, i+1, res_))
        time.sleep(2)  # 延时2s


    print("祝我好运！")
